package com.sky.context;

/**
 * 封装threadLocal常用方法
 * 前端每次请求，都是一个线程，可用来存储中间信息，在控制层，业务层调用
 */
public class BaseContext {

    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    public static Long getCurrentId() {
        return threadLocal.get();
    }

    public static void removeCurrentId() {
        threadLocal.remove();
    }

}
